package com.itheima.reggie.controller;

import com.itheima.reggie.common.R;
import com.itheima.reggie.entity.SetmealDish;
import com.itheima.reggie.service.SetmealDishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/setmeal")
public class SetmealDishController {
    @Autowired(required = false)
    private SetmealDishService setmealDishService;
    @GetMapping("/dish/{setmealId}")
    public R<List<SetmealDish>> findDishById(@PathVariable Long setmealId){
        List<SetmealDish> setmealDishList = setmealDishService.findDishById(setmealId);
        return R.success(setmealDishList);
    }
}
